const classNames = require('classnames')
const _ = require('../utils')

_.create('page', {
  options: {
    multipleSlots: true, // 在组件定义时的选项中启用多slot支持
  },

  properties: {
    title: {
      type: String,
      value: '',
    },
    subtitle: {
      type: String,
      value: '',
    },
    full: Boolean,
    transparent: {
      type: Boolean,
      value: true,
    },
    titleAlign: {
      type: String,
      value: '',
    },
  },

  computed: {
    classes: function (data) {
      const { classPrefix, full, transparent, titleAlign } = data
      const classes = classNames(classPrefix, {
        [`${classPrefix}-full`]: full,
        [`${classPrefix}-bg`]: !transparent,
        [`${classPrefix}_title-${titleAlign}`]: titleAlign,
      })

      return classes
    },
  },
})
